#ifndef __GAME_SCENE_H__
#define __GAME_SCENE_H__

#include "cocos2d.h"

USING_NS_CC;
using namespace std;
class MazeInfo;
class GameScene : public cocos2d::CCLayer
{
public:
	virtual bool init();  
	virtual void onEnter();

	// there's no 'id' in cpp, so we recommend returning the class instance pointer
	static cocos2d::CCScene* scene(int l);
	void returnMainMenu(CCObject* pSender);
	virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
	virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
	virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);

	bool isFillBlank();
	int getValidBlank();
	void wrongBorderBlinkFinished(CCNode* pTarget, void* data);
	void wrongOptionReturnFinished(CCNode* pTarget, void* data);
	void nextStepActionFinished(CCNode* pTarget, void* data);
	void displayOneOption(CCNode* pTarget, void* data);
	void nextStep();
	void nextLevel();
	void displayOptions();
	void loadLevel();
	void calculatePoints(int l);
	bool isRightAnswer(int qidx, int curstep, CCSprite *sp);

	int level;
	int curstep;
	int qestIdx;
	MazeInfo *info;
	vector<CCSprite* > quesSprites;
	vector<CCSprite* >  answSprites;
	map<int, vector<CCSprite* > >  optSprites;
	vector<CCPoint> blankPoints;
	vector<bool> blankFill;
	vector<CCPoint> optionPoints;
	CCSprite* rightBorderSp;
	CCSprite* wrongBorderSp;
	bool ispause;
	bool nextStepActionfinished;
	int optionShownum;

	vector<CCPoint> quesPts, optPts, ansPts;
	CREATE_FUNC(GameScene);
};

class MazeInfo
{
public:
	int level;
	int steps;
	int columns;
	vector<std::string> questions;
	vector<vector<string> > stepInfo; 
};

#endif

